package org.chnxi.study.springcloud.dubbo.storage.dto;

import lombok.Data;

import java.io.Serializable;

@Data
public class StorageDto implements Serializable {

    private String name;

    private int productId;

    private int actionType;

    private int count;

    public static void main(String[] args) {
        //(h = key.hashCode()) ^ (h >>> 16)
        StorageDto dto = new StorageDto();
        int objHashCode = 0-dto.hashCode();
        System.out.println("十进制："+objHashCode+"；二进制："+Integer.toBinaryString(objHashCode)+"[原始hashcode]");
        int newLong = objHashCode >>> 16;
        System.out.println("十进制："+newLong+"；二进制："+Integer.toBinaryString(newLong)+"【右移16位后】");
        int newLong2 = objHashCode ^ newLong;
        System.out.println("十进制："+newLong2+"；二进制："+Integer.toBinaryString(newLong2)+"【与原值^】");
        int idx = newLong2 & 15;
        System.out.println("十进制："+idx+"；二进制："+Integer.toBinaryString(idx)+"【& 15】");
        System.out.println("十进制："+15+"；二进制："+Integer.toBinaryString(15));

        System.out.println(2%15);
        System.out.println(2%31);
        System.out.println("==========");
        System.out.println(50&16);
        System.out.println(50&15);
        System.out.println(50&31);
        System.out.println("==========");
        int n = -1 >>> Integer.numberOfLeadingZeros(60 - 1);
        System.out.println(n);
    }

}
